package service_sys

import (
	"strings"
	"wrblog-api-go/app/dao/dao_sys"
	"wrblog-api-go/app/model/model_sys"
	"wrblog-api-go/pkg/utils"
)

func GetDictTypePageList(sysDictType model_sys.SelectSysDictType) ([]model_sys.SysDictTypeVo, int64, error) {
	return dao_sys.GetDictTypePageList(sysDictType)
}

func GetDictTypeById(dictId int) (model_sys.SysDictTypeVo, error) {
	return dao_sys.GetDictTypeById(dictId)
}

func AddDictType(sysDictType model_sys.SysDictTypePo) (int, error) {
	sysDictType.CreateTime = utils.NewTimeNow()
	return dao_sys.AddDictType(sysDictType)
}
func EditDictType(sysDictType model_sys.SysDictTypePo) (int64, error) {
	sysDictType.UpdateTime = utils.NewTimeNow()
	return dao_sys.EditDictType(sysDictType)
}

func RemoveDictType(dictIds string, uk string) (int64, error) {
	return dao_sys.RemoveDictType(strings.Split(dictIds, ","), uk)
}
